package com.shp;

import org.junit.Test;

import java.io.*;
import java.util.Properties;

/**
 * Description:
 *
 * @author zwl
 * @version 1.0
 * @date 2020/4/30 22:27
 */
public class testProperties {

    @Test
    public void test01() throws IOException {
        String ip = "123.123.1.1";
        Properties props = new Properties();
        InputStream in = new FileInputStream("E:/Java/work space-2019-09/SecondHandPlatform/src/main/resources/ip-black.properties");
        props.load(in);
        in.close();
        OutputStream fos = new FileOutputStream("E:/Java/work space-2019-09/SecondHandPlatform/src/main/resources/ip-black.properties");
        props.setProperty(ip, "ip");
        props.store(fos, "");
        fos.close();
    }
}
